Skip to content

Make the command-line tool correspond to what the modello-maven-plugin can do - #603

Open
fridrich wants to merge 3 commits into
codehaus-plexus:masterfrom
fridrich:master
Open

fridrich wants to merge 3 commits into
codehaus-plexus:masterfrom
fridrich:master

Conversation

@fridrich

@fridrich fridrich commented Sep 9, 2026 •

Copy link
Copy Markdown

What does this change?

This adds some command-line options to account for modello-maven-plugin options. All the options are incrementally optional. This allows to generate the source code using the command-line in the same way modello-maven-plugin would do.

This allows us to bootstrap some packages within distribution build environments, where maven needs modello-maven-plugin to generate its sources, but modello-maven-plugin is maven plugin and needs maven to run. The usual circular dependencies that make it really difficult to bootstrap stuff.

I don't expect this feature to have a ton of users out there, but I am carrying these patches for years and they are not breaking anything in upstream modello, so I would not mind them to be integrated.

@fridrich
fridrich force-pushed the master branch 5 times, most recently from 9ecf8c6 to 24cc443 Compare September 15, 2026 18:41
@fridrich

Copy link
Copy Markdown
Author

I got a change of mind. With the new plural exceptions parameter, I realized that this stuff of positional arguments is extra-super fragile. So, I take the positional argument version that was there until now and add another, more scalable way, with --* arguments.

@slachiewicz

Copy link
Copy Markdown
Member

as this is new/upgraded feature - lets assume it will b eversion 2.9.0 for since tag

@slachiewicz

Copy link
Copy Markdown
Member

can you also take a look at #15 if is still valid?

@fridrich

Copy link
Copy Markdown
Author

can you also take a look at #15 if is still valid?

I normally did not have this kind of problems, but given the injection, the right classpath is of essence. I am generating the script called modello in our openSUSE rpm build using this command:

%jpackage_script org.codehaus.modello.ModelloCli "" "-Dguice_custom_class_loading=CHILD" modello:aopalliance:atinject:commons-lang3:google-guice:guava:jackson-core:jakarta-inject:javadoc-parser:jsoup/jsoup:objectweb-asm/asm:plexus/plexus-build-api:plexus/plexus-build-api0:plexus/classworlds:plexus-containers/plexus-component-annotations:plexus/utils:plexus/xml:org.eclipse.sisu.inject:org.eclipse.sisu.plexus:slf4j/api:slf4j/simple:snakeyaml:velocity-engine/velocity-engine-core %{name} true

where modello is actually a directory with all the jars minus maven plugin. Some dependencies, like plexus-xml or jakarta-inject are there because of which version of plexus-utils and guice we use. The classpath is known to work well and I am generating on command-line all the code needed for build of maven 3.10.x and 4.0.x. Although, the maven 4.0.x needs two additional patches extending the positional arguments. Now with the plural exceptions, I came to a point when I realized that 11th optional positional argument will be a huge mess. So, I came with this syntax.

@fridrich

Copy link
Copy Markdown
Author

as this is new/upgraded feature - lets assume it will b eversion 2.9.0 for since tag

Changed that as a fixup of the commit moving those constants. Also fixed the javadoc:javadoc, by adding the artifact modello-plugin-velocity as additional dependency for the maven-javadoc-plugin. Besides that it can be scope runtime as the others. Eventually they could be all optional according to which generator is needed, but that is bigger change and would need more testing of cross-module dependencies.

The by-product of this is that the maven plugin does not hard-depend
on modello-plugin-velocity to compile.
Positional arguments are scalability nightmare. Add alternative way
of specifying command-line options. However keep positional arguments
as not to break backward compatiblity.

Also add tests for the ModelloCli

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants